@extends('layouts.app')

@section('content')



<script src="{{ URL::asset('/') }}js/html2canvas.js"></script>




<script type="text/javascript">
function takeScreenshot() {
  console.log('test');
    html2canvas(document.getElementById('view'), {
        onrendered: function(canvas) {
            console.log(canvas);
            var myImage = canvas.toDataURL("image/jpeg");  //base64
             console.log(myImage);

             var urls = "{{url('admin/case/upcf')}}";
              var casid = "{{$case->case_id}}";

            //并将图片上传到服务器用作图片分享  
            $.ajax({  
                type : "POST",  
                url : urls,  
                data: {'img':myImage,'_token':'{{csrf_token()}}','caseid':casid},
                dateType: 'json',    
               
                success : function(data){
                    var obj = eval( "(" + data + ")" );
                     console.log(obj);
                     
                      if (obj.style == 1) {
                       alert(obj.message);
                       self.location= "{{url('admin/case/index')}}"; 
                     }

                  
                    // $('#myShowImage').attr('src', '${ctxStatic}/usertemp/'+data+'.jpg'); //服务器上保存图片路径，data是返回的文件名。  
                }  
            });  

            document.body.appendChild(canvas);
        },
      width: 900,
      // height: 955,
    });
}
</script>



     <div class="content">
        <div class="main-content">
    
              <div class="row">
                  <button class="btn btn-primary" onclick="takeScreenshot()">提交</button>
                  <a href="javascript:history.back(-1);" class="btn btn-back">返回</a>

                    <div class="form" id="view" style="background-color: #FFF;width:900px;">


                    <div class="table">
                      <h1 class="form_tit mg_t25">XXX<span class="lp">公安局</span>___分局</h1>
                      <h1 class="form_tit">当场处罚决定书</h1>
                      <div class="form_head_r">
                        编号：<span class="w80 bdno"></span>
                      </div>
                      <div class="form_n">
                        <p class="tx_d2">
                          违法单位名称：<span class="form_n_txt">{{$unit->name}}</span>法定代表人：<span class="form_n_txt">{{$unit->frdb_name}}</span>单位地址：<span class="form_n_txt">{{$unit->area}}{{$unit->road}}{{$unit->village}}{{$unit->house_number}}</span>
                        </p>
                        <p class="tx_d2">
                          现查明<br/>
                          <span class="form_n_txt">{{$hg->cont}}</span>,以上事实有<span class="form_n_txt">{{$hg->zjss}}</span>等证据证明。
                        </p>
                        <P class="tx_d2">根据<span class="txt-und">《企业事业单位内部治安保卫条例》</span>第<span class="txt-und">十九</span>条之规定，决定给予<span class="form_n_txt">{{$hg->cffs}}</span>的处罚。</P>
                        <P class="tx_d2">执行方式：<span class="form_n_txt">{{$hg->zxfs}}</span>。</P>
                        <P class="tx_d2">如不服本决定，可以在收到本决定书之日起六十日内向<span class="form_n_txt">{{$hg->sqga}}</span>申请行政复议或者在三个月内已发向<span class="form_n_txt">{{$hg->ssfy}}</span>人民法院提起行政诉讼。</P>
                        <P class="tx_d2">处罚地点：<span class="form_n_txt">{{$hg->cfd}}</span></P>
                        <P class="tx_d2">办案人民警察：<span class="form_n_txt">{{$hg->bamj}}</span></P>
                      </div>
                      <p class="ph1"></p>
                      <div class="form_right">
                        <p>公安机关(印)</p>
                        <div class="form_time">
                          <span class="w80 bdno"></span>年<span class="w80 bdno"></span>月<span class="w80 bdno"></span>日
                        </div>
                      </div>
                      <div class="form_n">
                        <p class="tx_d2">
                          处罚前一口头告知违法行为人拟作出罚的事实、理由和依据，并告知违法行为人已发享有陈述权和申辩权。
                        </p>
                      </div>
                      <div class="form_unit">
                        <p class="tx_d2">被处罚单位：<span class="input_b bdno">{{$unit->name}}</span></p> 
                        <div class="dsp">
                          <span class="w80 bdno"></span>{{$hg->add_time}}
                        </div>
                      </div>
                    </div>
                   
                  </div>      
       
        </div>



      </div>

           
        </div>

   


@stop
